/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.clientapi.provider;

import com.jili.ubert.clientapi.until.AnswerHandler;
import com.jili.ubert.code.client2server.RequestPageData;
import com.jili.ubert.dao.DBTableName;
import com.jili.ubert.dao.db.FundTransfer;
import com.jili.ubert.dao.db.IOPVAccount;
import com.jili.ubert.dao.recent.RecentClearingDayBook;
import com.jili.ubert.dao.recent.RecentClearingFundState;
import com.jili.ubert.dao.recent.RecentClearingPosDetail;
import com.jili.ubert.dao.recent.RecentTradeAlterOrder;
import com.jili.ubert.dao.recent.RecentTradeCancelOrder;
import com.jili.ubert.dao.recent.RecentTradeExecuteOrder;
import com.jili.ubert.dao.recent.RecentTradeNewOrder;
import com.jili.ubert.dao.recent.RecentTradeReportDetail;
import com.panemu.tiwulfx.common.TableData;
import java.io.IOException;

/**
 *
 * @author ChengJili
 */
public interface HistoryDataProvider {
//    public MsgResult Connect(String host,int port,boolean isSSL,boolean isZlib);
//    public MsgResult Login(Login login);
//    public MsgResult UserLogin(Login login);
    
    /*
    交易查询
    */
    //1.历史委托
    public int QueryHistoryOrders(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentTradeNewOrder>> handler) throws IOException;
    public int QueryHistoryOrders(RequestPageData rpd, AnswerHandler<TableData<RecentTradeNewOrder>> handler) throws IOException;
    
    public int QueryHistoryCancelOrders(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentTradeCancelOrder>> handler) throws IOException;
    public int QueryHistoryCancelOrders(RequestPageData rpd, AnswerHandler<TableData<RecentTradeCancelOrder>> handler) throws IOException;
    
    public int QueryHistoryAlterOrders(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentTradeAlterOrder>> handler) throws IOException;
    public int QueryHistoryAlterOrders(RequestPageData rpd, AnswerHandler<TableData<RecentTradeAlterOrder>> handler) throws IOException;
    //2.历史回报详情
    public int QueryHistoryOrderReports(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentTradeReportDetail>> handler) throws IOException;
    public int QueryHistoryOrderReports(RequestPageData rpd, AnswerHandler<TableData<RecentTradeReportDetail>> handler) throws IOException;
    //3.历史委托成交
    public int QueryHistoryOrderExecteStatus(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentTradeExecuteOrder>> handler) throws IOException;
    public int QueryHistoryOrderExecteStatus(RequestPageData rpd, AnswerHandler<TableData<RecentTradeExecuteOrder>> handler) throws IOException;
    //4.历史持仓
    public int QueryHistoryPosList(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentClearingPosDetail>> handler) throws IOException;
    public int QueryHistoryPosList(RequestPageData rpd, AnswerHandler<TableData<RecentClearingPosDetail>> handler) throws IOException;
    //5.历史资金结算流水
    public int QueryHistoryFundStatus(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentClearingFundState>> handler) throws IOException;
    public int QueryHistoryFundStatus(RequestPageData rpd, AnswerHandler<TableData<RecentClearingFundState>> handler) throws IOException;
    //6.资金流水，结算单
    public int QueryHistoryClearingsDayBook(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<RecentClearingDayBook>> handler) throws IOException;
    public int QueryHistoryClearingsDayBook(RequestPageData rpd, AnswerHandler<TableData<RecentClearingDayBook>> handler) throws IOException;
    //7.净值数据
    public int QueryHistoryNetFund(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<IOPVAccount>> handler) throws IOException;
    public int QueryHistoryNetFund(RequestPageData rpd, AnswerHandler<TableData<IOPVAccount>> handler) throws IOException;
    //8.出入金流水
    public int QueryHistoryFundTransfer(String accountCode,int maxNum,boolean sortDirect,AnswerHandler<TableData<FundTransfer>> handler) throws IOException;
    public int QueryHistoryFundTransfer(RequestPageData rpd, AnswerHandler<TableData<FundTransfer>> handler) throws IOException;
    //9.
    /*
    public MsgResult Save(HistoryDBTableName tablename,Object obj);
    public MsgResult HSQLSave(String hsql);
    public MsgResult SQLSave(String sql);
    public MsgResult Update(HistoryDBTableName tablename,Object obj);
    public MsgResult HSQLUpdate(String hsql);
    public MsgResult SQLUpdate(String sql);
    public MsgResult Delete(HistoryDBTableName tablename,Object obj);
    public MsgResult HSQLDelete(String hsql);
    public MsgResult SQLDelete(String sql);
    */
    public int Select(DBTableName tablename, String key, AnswerHandler<TableData> handler) throws IOException;
    public int HSQLSelect(String hsql, AnswerHandler<TableData> handler) throws IOException;
    public int SQLSelect(String sql, AnswerHandler<TableData> handler) throws IOException;
    /*
    痕迹查询
    */
}
